	function createPoint() {
		var address = document.getElementById("google_address").value;
		var frame = document.getElementById("frame_google_map");
		if (address != "") {
			var geocoder = new GClientGeocoder();
			if (geocoder) {
				geocoder.getLatLng(
					address,
					function(point) {
						if (!point) {
						frame.style.display = "none";
						} else {
							//alert('X = ' + point.x + ' ; Y = ' + point.y);
							loadMap(point.x, point.y)
						}
					}
				);
			}//end if        
		}
	}//end func
	
	var map;
	
	function loadMap(lat, lon) {
		map = new GMap2(document.getElementById("map_canvas"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(lon, lat), 14);
		addPoints(lat, lon);
	}
	function addPoints(lat, lon) {
		var newpoints = new Array();
		newpoints[0] = new Array(lat, lon);
		
		for(var i = 0; i < newpoints.length; i++) {
			var point = new GPoint(newpoints[i][0],newpoints[i][1]);
			var marker = createMarker(point);
			map.addOverlay(marker);
		}
	}
	
	function createMarker(point) {
		var marker = new GMarker(point);
		var address = document.getElementById("google_address").value;
		var popupHtml = "<br>"+address;
		GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(popupHtml);
		});
		
		return marker;
	}	
	window.onload = createPoint;